#include "../include/TeamButton.h"
using namespace Gtk;

TeamButton::TeamButton(int team):Button("   "){
    //ctor
    setTeam(team);
    Button::signal_clicked().connect(sigc::mem_fun(*this, &TeamButton::swapteam));

}

TeamButton::~TeamButton(){
    //dtor
}
void TeamButton::swapteam(){
setTeam(!m_team);
}
int TeamButton::getTeam(){
    return m_team;
}
void TeamButton::setTeam(int team){
    m_team=team;
    if(team){
        modify_bg(STATE_ACTIVE, Gdk::Color("blue"));
        modify_bg(STATE_INSENSITIVE, Gdk::Color("blue"));
        modify_bg(STATE_NORMAL, Gdk::Color("blue"));
        modify_bg(STATE_PRELIGHT, Gdk::Color("blue"));
        modify_bg(STATE_SELECTED, Gdk::Color("blue"));
    } else {
        modify_bg(STATE_ACTIVE, Gdk::Color("red"));
        modify_bg(STATE_INSENSITIVE, Gdk::Color("red"));
        modify_bg(STATE_NORMAL, Gdk::Color("red"));
        modify_bg(STATE_PRELIGHT, Gdk::Color("red"));
        modify_bg(STATE_SELECTED, Gdk::Color("red"));
    }
}
